package com.xbongbong.saas.service;


import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.pojo.AssociatedBusinessAfterSavePojo;
import com.xbongbong.paas.pojo.dto.ProcessNodeTaskUpdateDTO;
import com.xbongbong.paas.pojo.dto.SaasFormSaveDTO;
import com.xbongbong.paas.pojo.dto.ValidateDataDTO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.businessdata.pojo.dto.FormatExplainDTO;
import com.xbongbong.pro.businessproduct.pojo.dto.BusinessProductListDTO;
import com.xbongbong.pro.detailtab.dto.ChangeDocumentStatusSaveDTO;
import com.xbongbong.pro.detailtab.vo.ChangeDocumentStatusSaveVO;
import com.xbongbong.pro.detailtab.vo.ProductSummaryVO;
import com.xbongbong.pro.formdata.pojo.dto.SaasAnalysisDataDTO;
import com.xbongbong.pro.formexplain.pojo.dto.HandlerExplainInLinkItemDTO;
import com.xbongbong.pro.returned.pojo.dto.ReturnDeleteBatchDTO;
import com.xbongbong.pro.returned.pojo.dto.ReturnEditAttrUpdateDTO;
import com.xbongbong.pro.returned.pojo.vo.ReturnDeleteBatchVO;
import com.xbongbong.pro.returned.pojo.vo.ReturnEditAttrUpdateVO;

/**
 * @author wujian
 * @version v1.0
 * @date 2020/12/31
 * @since v1.0
 */
public interface ReturnService {

    /**
     * 退货单保存前校验
     * @param validateDataDTO
     * @throws XbbException
     */
    void beforeSave(ValidateDataDTO validateDataDTO) throws XbbException;

    /**
     * 退货单保存后逻辑
     * @param saasFormSaveDTO
     * @throws XbbException
     */
    void afterSave(SaasFormSaveDTO saasFormSaveDTO, AssociatedBusinessAfterSavePojo associatedBusinessAfterSavePojo) throws XbbException;

    /**
     * 更新退货退款开启关闭状态
     * @param changeDocumentStatusSaveDTO
     * @return
     */
    ChangeDocumentStatusSaveVO changeDocumentStatus(ChangeDocumentStatusSaveDTO changeDocumentStatusSaveDTO) throws XbbException;

    /**
     * 新建时格式化解释
     *
     * @param formatExplainDTO 入参
     * @throws XbbException 异常
     * @author long.rao
     * @date 2019-02-22 14:55
     */
    void formatAddExplain(FormatExplainDTO formatExplainDTO) throws XbbException;

    /**
     * 判断进销存是否开启
     *
     * @param corpid 公司Id
     * @return boolean
     * @author wujian
     * @date 2020/12/31 8:50
     * @since v1.0
     * @throws XbbException 业务异常
     */
    boolean ifJXCOpen(String corpid) throws XbbException;

    /**
     * Description: 批量编辑单个字段
     * @param returnEditAttrUpdateDTO
     * @return ReturnEditAttrUpdateVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/5/9 17:07
     * @since v1.0
     */
    ReturnEditAttrUpdateVO batchEditAttr(ReturnEditAttrUpdateDTO returnEditAttrUpdateDTO) throws XbbException;

    /**
     * 批量删除出库单
     * @author 吴峰
     * @date 2019/3/15 14:34
     * @param returnDeleteBatchDTO
     * @return com.xbongbong.pro.outstock.pojo.vo.OutstockDeleteBatchVO
     * @throws XbbException 业务异常
     */
    ReturnDeleteBatchVO deleteBatch(ReturnDeleteBatchDTO returnDeleteBatchDTO) throws XbbException;

    /**
     * 关联新建格式化解释
     *
     * @param handlerExplainInLinkItemDTO 入参
     * @throws XbbException 异常
     */
    void formatLinkAddExplain(HandlerExplainInLinkItemDTO handlerExplainInLinkItemDTO) throws XbbException;

    /**
     * 汇总机会产品信息（详情页，几种产品几件）
     *
     * @param businessProductListDTO 入参
     * @throws XbbException
     */
    ProductSummaryVO summaryProductList(BusinessProductListDTO businessProductListDTO) throws XbbException;

    void processTaskEnd(ProcessNodeTaskUpdateDTO processNodeTaskUpdateDTO);
}
